import 'dart:convert';

LoginModel loginModelFromJson(String str) => LoginModel.fromJson(json.decode(str));

String loginModelToJson(LoginModel data) => json.encode(data.toJson());

class LoginModel {
  int code;
  String ? msg;
  LoginData ? data;

  LoginModel({
    required this.code,
    this.msg,
    this.data,
  });

  factory LoginModel.fromJson(Map<String, dynamic> json) => LoginModel(
    code: json["code"],
    msg: json["msg"],
    data: json["data"] != null ? LoginData.fromJson(json["data"]) : null,
  );

  Map<String, dynamic> toJson() => {
    "code": code,
    "msg": msg,
    "data": data?.toJson(),
  };
}

class LoginData {
  String tokenHead;
  String token;

  LoginData({
    required this.tokenHead,
    required this.token,
  });

  factory LoginData.fromJson(Map<String, dynamic> json) => LoginData(
    tokenHead: json["tokenHead"],
    token: json["token"],
  );

  Map<String, dynamic> toJson() => {
    "tokenHead": tokenHead,
    "token": token,
  };
}
